package com.wxd.service;

import com.wxd.config.WebConfig;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;

/**
 * @author wxd
 * @version V1.0
 * @description CustomService2
 * @date 2022/10/12 16:16
 **/
@Service
public class CustomService2 implements ApplicationContextAware {
    private ApplicationContext applicationContext;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }

    public void test() {
        WebConfig webConfig = (WebConfig) applicationContext.getBean("webConfig");
    }
}
